﻿using System;
using Moe.ECamel.Client.Controllers;
using Moe.ECamel.Client.WinForms.Common;
using Moe.ECamel.Common.Entities;

namespace Moe.ECamel.Client.WinForms.Controls
{
	public partial class PaymentDetailsControl : ECamelUserControl
	{
		public PaymentDetailsControl()
		{
			InitializeComponent();
		}

		private DetailsMode _detailsMode;
		public DetailsMode DetailsMode
		{
			get { return this._detailsMode; }
			set
			{
				this._detailsMode = value;
			}
		}


		public void Bind(Payment entity)
		{
			PaymentBindingSource.DataSource = entity;
			this.PaymentIdTextBox.Bind(PaymentBindingSource, "PaymentId");
			this.PaymentTypeDescTextBox.Bind(PaymentBindingSource, "PaymentTypeDesc");
			this.PayedOnDateTimeBox.Bind(PaymentBindingSource, "PayedOn");
			this.AmountNumericBox.Bind(PaymentBindingSource, "Amount");
			this.DescriptionTextBox.Bind(PaymentBindingSource, "Description");
		}

		public void CancelEdit()
		{
			this.PaymentBindingSource.CancelEdit();
		}
	}
}
